package com.sls.game.dao.xinhe.impl;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.sls.game.dao.impl.SuperDAO;
import com.sls.game.dao.xinhe.XinHeChargeUnitDAO;
import com.sls.game.pojo.xinhe.XinHeChargeUnit;

@Repository("xinHeChargeUnitDAO")
public class XinHeChargeUnitDAOImpl extends SuperDAO<XinHeChargeUnit> implements
		XinHeChargeUnitDAO {

	@Override
	public void insert(XinHeChargeUnit chargeUnit) {
		this.getSqlSession().insert("mybatis.xml.XinHeChargeUnitMapper.insert",
				chargeUnit);

	}

	@Override
	public void update(XinHeChargeUnit chargeUnit) {
		this.getSqlSession().update("mybatis.xml.XinHeChargeUnitMapper.update",
				chargeUnit);

	}

	@Override
	public XinHeChargeUnit queryByChargeId(XinHeChargeUnit chargeUnit) {
		return this.getSqlSession()
				.selectOne("mybatis.xml.XinHeChargeUnitMapper.queryByChargeId",
						chargeUnit);
	}

	@Override
	public List<XinHeChargeUnit> queryGiftByCidAndGid(XinHeChargeUnit chargeUnit) {
		List<XinHeChargeUnit> list = this.getSqlSession().selectList(
				"mybatis.xml.XinHeChargeUnitMapper.queryChargeByCidAndGid",
				chargeUnit);
		return list;
	}

	@Override
	public List<String> queryRechargeNameByCompanyId(String companyId) {
		List<String> list = this
				.getSqlSession()
				.selectList(
						"mybatis.xml.XinHeChargeUnitMapper.queryRechargeNameByCompanyId",
						companyId);
		return list;
	}

}
